package com.colin.util.design.chain;

import com.colin.util.design.chain.base.ChainDto;
import com.colin.util.exception.BusiException;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;

@Component
public class ChainContext {

    @Resource
    private List<PlatWithdrawDeal> platWithdrawDeals;
    
    public void nextPlatWithdrawDeal(ChainDto chainDto) throws BusiException {
        if(chainDto.getRequest().getIndex() < platWithdrawDeals.size()){
            platWithdrawDeals.get(chainDto.getRequest().getIndex()).deal(chainDto);
        }
    }
}
